<template>
  <div class="bottom">
    <tabbar v-model="index">
      <tabbar-item link="/index">
        <img slot="icon" src="static/bottom/buy_gray.png">
        <img slot="icon-active" src="static/bottom/buy_green.png">
        <span slot="label">采购</span>
      </tabbar-item>
      <tabbar-item link="/item/wallet/account">
        <img slot="icon" src="static/bottom/huishou_gray.png">
        <img slot="icon-active" src="static/bottom/huishou_green.png">
        <span slot="label">回收</span>
      </tabbar-item>
      <tabbar-item link="/init/wallet">
        <img slot="icon" src="static/bottom/wallet_gray.png">
        <img slot="icon-active" src="static/bottom/wallet_green.png">
        <span slot="label">钱包</span>
      </tabbar-item>
    </tabbar>
  </div>
</template>

<script>
  import { Tabbar, TabbarItem, Group, Cell } from 'vux'

  export default {
    components: {
      Tabbar,
      TabbarItem,
      Group,
      Cell
    },
    data () {
      return {
        index: 0
      }
    },
    created () {
      let vue = this;
      let path=this.$route.path;
      if(path=='/index'){
        this.index=0;
      }else if(path=='/init/wallet'){
        this.index=2;
      }
    },
  }
</script>
<style>
.bottom{
  overflow: hidden;
  margin-top:57px;
}
  .weui-bar__item_on .weui-tabbar__label span{
    color: #51ac33;
  }
  .weui-tabbar{
    background-color: #fff !important;
  }
  .weui-tabbar:before{
    border-top:0px !important;
  }
</style>
